package com.example.zhugenew.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.example.mymvplibrary.adapter.BaseAdapter;
import com.example.mymvplibrary.adapter.BaseViewHolder;
import com.example.zhugenew.R;
import com.example.zhugenew.bean.KouBeiBean;

import java.util.List;

public class KouBeiAdapter extends BaseAdapter<KouBeiBean.ListBean> {
    public KouBeiAdapter(List<KouBeiBean.ListBean> datas, Context context, int layoutId) {
        super(datas, context, layoutId);
    }

    @Override
    public void bindData(BaseViewHolder holder, KouBeiBean.ListBean listBean, int pos) {
        ImageView iv_image = holder.getView(R.id.image_view);
        Glide.with(context).load(listBean.getThumb()).into(iv_image);
        TextView tv_name = holder.getView(R.id.text_name);
        tv_name.setText(listBean.getName());
        TextView tv_cate = holder.getView(R.id.tv_shouname);
        tv_cate.setText(listBean.getCateStatus().getName());
        TextView tv_cata= holder.getView(R.id.cate_cire);
        tv_cata.setText(listBean.getCate_circle()+"/");
        TextView tv_kp = holder.getView(R.id.tv_kedate);
        tv_kp.setText("开盘时间:"+listBean.getKpdate());

        TextView tv_price = holder.getView(R.id.text_price);
        tv_price.setText(listBean.getPrice());

        TextView tv_unit= holder.getView(R.id.tv_price_unit);
        tv_unit.setText(listBean.getPrice_unit());

        RecyclerView rv_list = holder.getView(R.id.rlv_in);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        rv_list.setLayoutManager(linearLayoutManager);
        HighTwoAdapter rlvInAdapter = new HighTwoAdapter(datas,context,R.layout.layout_items);
        rv_list.setAdapter(rlvInAdapter);
    }


}
 